package com.qsw.paper.mapper;

import com.qsw.paper.pojo.entity.ThesisVersions;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author qsw
 * @since 2024-11-15
 */
@Mapper
public interface ThesisVersionsMapper extends BaseMapper<ThesisVersions> {

    @Select("SELECT * FROM thesis_versions WHERE thesis_id = #{thesisId} ORDER BY version_number DESC LIMIT 1")
    ThesisVersions selectLatestVersionByThesisId(@Param("thesisId") Integer thesisId);

}
